# coding=utf-8
def arithmetic():
	n = 49
	i = 1
	s = 0
	while i <= n:
		s = s+i
		i += 2

	print(s)

def arithmetic2():
	s = 0
	for i in range(1,50,2):
		s += i

	print(s)

def Fibonacc(n = 30):
	Fn = [0,1]
	for i in range(2,n+1):
		Fn.append(Fn[i-1]+Fn[i-2])

	Fn.pop(0)
	print('Fn有%d项'%len(Fn))
	print(Fn)


arithmetic()		#第一题while写法
arithmetic2()		#第一题FOR写法
Fibonacc()		#第二题代码，n的默认值为30

